package com.yazi.mxz.common.entity.beans;

import javax.persistence.Column;
import javax.persistence.Embeddable;

/**
 * GoodsGiftId entity. @author MyEclipse Persistence Tools
 */
@Embeddable
public class GoodsGiftId implements java.io.Serializable {

	// Fields

	private Long sellId;
	private Long giftId;
	private Integer type;

	// Constructors

	/** default constructor */
	public GoodsGiftId() {
	}

	/** full constructor */
	public GoodsGiftId(Long sellId, Long giftId, Integer type) {
		this.sellId = sellId;
		this.giftId = giftId;
		this.type = type;
	}

	// Property accessors

	@Column(name = "SELL_ID", nullable = false, precision = 15, scale = 0)
	public Long getSellId() {
		return this.sellId;
	}

	public void setSellId(Long sellId) {
		this.sellId = sellId;
	}

	@Column(name = "GIFT_ID", nullable = false, precision = 15, scale = 0)
	public Long getGiftId() {
		return this.giftId;
	}

	public void setGiftId(Long giftId) {
		this.giftId = giftId;
	}

	@Column(name = "TYPE", nullable = false, precision = 8, scale = 0)
	public Integer getType() {
		return this.type;
	}

	public void setType(Integer type) {
		this.type = type;
	}

	public boolean equals(Object other) {
		if ((this == other))
			return true;
		if ((other == null))
			return false;
		if (!(other instanceof GoodsGiftId))
			return false;
		GoodsGiftId castOther = (GoodsGiftId) other;

		return ((this.getSellId() == castOther.getSellId()) || (this.getSellId() != null
				&& castOther.getSellId() != null && this.getSellId().equals(castOther.getSellId())))
				&& ((this.getGiftId() == castOther.getGiftId()) || (this.getGiftId() != null
						&& castOther.getGiftId() != null && this.getGiftId().equals(
						castOther.getGiftId())))
				&& ((this.getType() == castOther.getType()) || (this.getType() != null
						&& castOther.getType() != null && this.getType()
						.equals(castOther.getType())));
	}

	public int hashCode() {
		int result = 17;

		result = 37 * result + (getSellId() == null ? 0 : this.getSellId().hashCode());
		result = 37 * result + (getGiftId() == null ? 0 : this.getGiftId().hashCode());
		result = 37 * result + (getType() == null ? 0 : this.getType().hashCode());
		return result;
	}

}